package com.quanyue.haircut.shop.service;

import com.quanyue.auto.sharding.conf.TargetDataSource;
import com.quanyue.haircut.domain.entity.Card;
import com.quanyue.haircut.domain.entity.CardScope;
import com.quanyue.haircut.domain.entity.User;
import com.vhuomai.mybatis.mapper.page.Page;
import com.vhuomai.mybatis.mapper.page.PageRequest;

import java.util.List;

public interface CardService {

    //根据店铺查询所有会员卡会员信息
    @TargetDataSource(value = "sharding")
    Page <User> findUserByShop(PageRequest request, Integer shopId);

    // 查询我的卡片信息
    List <Card> findCardByUser(Integer userId);

    // 查询当前店铺下的会员卡
    Card findCardByUserAndShop(Integer userId, Integer shopId);

    // 设置会员卡是否通用
    void updateCardScope(Boolean isCommon, Integer merchantNo);

    // 查询会员卡通用状态
    CardScope selectCardScope(Integer merchantNo);

    @TargetDataSource(value = "sharding")
    Card createCard(Card card);

    void updateCard(Card card);

    void deleteCard(Integer cardId);
}
